package any.functor.impl.pred;

import java.util.Map.Entry;

import any.ImmutableAny;
import any.impl.util.Utils;

public class HasKey extends BasePredicate<Entry<String, ? extends ImmutableAny>> {

	private final String key;

	public HasKey(String key) {
		this.key = key;
	}

	public boolean apply(Entry<String, ? extends ImmutableAny> entry) {
		return Utils.equals(entry.getKey(), key);
	}

	@Override
	public String toString() {
		//TODO: Quoting => LookupToken 
		return "hasKey '" + key + "'";
	}
	
}
